fun main() {
    println("Hello World!")

    /**
     * 示例 1:
     *
     * 输入: nums = [1,3,5,6], target = 5
     * 输出: 2
     * 示例 2:
     *
     * 输入: nums = [1,3,5,6], target = 2
     * 输出: 1
     * 示例 3:
     *
     * 输入: nums = [1,3,5,6], target = 7
     * 输出: 4
     *
     */
//    val index = searchInsert(intArrayOf(1, 3, 5, 6), 5)
//    val expected = "2"

//    val index = searchInsert(intArrayOf(1, 3, 5, 6), 2)
//    val expected = "1"
//
//    val index = searchInsert(intArrayOf(1, 3, 5, 6), 7)
//    val expected = "4"

//    val index = searchInsert(intArrayOf(1), 0)
//    val expected = "0"


    val index = searchInsert(intArrayOf(1,3,5), 4)
    val expected = "2"

    val actual = "" + index

    System.err.println(index)


    if (actual == expected) {
        println("OK")
    } else {
        println("Fail")
    }
}